package com.microstation.service.impl;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.microstation.service.HotelInfoService;
import com.microstation.dao.HotelInfoDao;
import com.microstation.common.Assist;
import com.microstation.common.Result;
import com.microstation.entity.po.HotelInfo;
/**
 * HotelInfo的服务接口的实现类
 * 
 * @author 
 *
 */
@Service
public class HotelInfoServiceImpl implements HotelInfoService {
	private final Logger LOG = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private HotelInfoDao hotelInfoDao;

	@Override
	public Result find(Assist assist) {
		//TODO这里可以做通过Assist做添加查询
		long results = hotelInfoDao.getHotelInfoRowCount(assist);
		List<HotelInfo> result = hotelInfoDao.selectHotelInfo(assist);
		return new Result(results, result);
	}
	@Override
	public HotelInfo findOne(Long id) {
		if (id == null) {
			return null;
		}
		HotelInfo result = hotelInfoDao.selectHotelInfoById(id);
		return result;
	}

	@Override
	public Integer saveNotNull(HotelInfo value) {
		if (value == null) {
			return null;
		}
		int result = hotelInfoDao.insertNotNullHotelInfo(value);
		return result;
	}
	@Override
	public Integer updateNotNullById(HotelInfo value) {
		if (value == null) {
			return null;
		}
		int result = hotelInfoDao.updateNotNullHotelInfoById(value);
		return result;
	}

	@Override
	public Integer deleteById(Long id) {
		if (id == null) {
			return null;
		}
		int result = hotelInfoDao.deleteHotelInfoById(id);
		return result;
	}


}